from threading import Thread
import time

def fun1(thread_name,delay):
    print('开始运行fun1,线程名字：%s'%(thread_name))
    time.sleep(delay)
    print('运行fun1结束')

def fun2(thread_name,delay):
    print('开始运行fun2,线程名字：%s'%(thread_name))
    time.sleep(delay)
    print('运行fun2结束')

if __name__ == "__main__":
    print('开始运行')
    t1 = Thread(target=fun1,args=('t1',4))
    t2 = Thread(target=fun2,args=('t2',2))
    t1.start()
    t2.start()
    t1.join()
    t2.join()
    print('ending...')
